import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      "~utils": "/src/utils",
      "~/": "/src/",
      "~service": "/src/service/",
      "~components": "/src/components/",
      "~shared": "/src/utils/shared/",
    },
    extensions: [".ts", ".tsx", ".js", ".jsx"],
  },
  server: {
    // 设置服务启动端口号
    port: 2103,
    open: true,
    host: "0.0.0.0",
    cors: true,
    // 设置代理，根据我们项目实际情况配置
    proxy: {},
  },
  css: {
    preprocessorOptions: {
      less: {
        javascriptEnabled: true,
      },
    },
  },
});
